<template>
	<view>
		<view v-for="(item,index) in list" @click="hanldeMegInfo(item.id)">
			<view class="pad-30 list">
				<view class="font-32">{{item.title}}</view>
				<view class="font-28 mar-top-10">{{item.message}}</view>
				<view class="font-24 text-right mar-top-20 u-info">{{item.create_time}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue';
	// 接口引入
	import {
		messageList
	} from '/config/api.js';

	import {
		onLoad
	} from '@dcloudio/uni-app';

	import {
		baseUrl
	} from '@/common/config.js'

	import {
		toast
	} from '@/uni_modules/uview-plus'

	// 获取列表
	let params = reactive({
		page: 1,
		page_size: 15
	})

	// 获取消息列表
	let list = ref([])
	const getListInfo = () => {
		messageList(params).then(({
			data
		}) => {
			list.value = list.value.concat(data.data)
		})
	}

	// 跳转详情
	const hanldeMegInfo = (id) => {
		uni.navigateTo({
			url: '/pages/messageInfo/messageInfo?id=' + id
		})
	}

	// 初始化加载
	onLoad(() => {
		getListInfo();
	})
</script>

<style scoped>
	.list {
		border-bottom: 1rpx solid #f5f5f5;
	}
</style>